package com.ukit.todolist_xml.RoomRepository

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query

@Dao
interface ToDoItemDao {
    @Insert
    suspend fun insert(item: ToDoItem)

    @Query("SELECT * FROM todo_items")
    suspend fun getAllItems(): MutableList<ToDoItem>

    @Query("UPDATE todo_items SET completed = :completed WHERE id = :itemId")
    suspend fun updateCompleted(itemId: Long, completed: Boolean)
}
